package org.xdoclet.plugin.qtags.impl.test;

import com.thoughtworks.qdox.model.AbstractJavaEntity;

public class FooBarOnceTagImpl extends org.xdoclet.XDocletTag implements org.xdoclet.plugin.qtags.impl.test.FooBarOnceTag {
    public static final String NAME = "foo.bar-once";
    private static final java.util.List ALLOWED_PARAMETERS = java.util.Arrays.asList( new String[] {
    	""
    });

    private static final java.util.List ALLOWED_VALUES = java.util.Arrays.asList( new String[] {
        ""
    });
    public FooBarOnceTagImpl(String name, String value, com.thoughtworks.qdox.model.AbstractBaseJavaEntity entity, int lineNumber) {
        super(name, value, entity, lineNumber);
    }


    protected void validateLocation() {
		if(isOnConstructor) {
        	bomb("is not allowed on constructors");
		}

        // check uniqueness
		if(((AbstractJavaEntity)getContext()).getTagsByName(NAME).length > 1) {
			bomb("is allowed only once");
		}

        // warn deprecation

        // check for allowed values for whole tag
        if( ALLOWED_VALUES.size() > 1 && !ALLOWED_VALUES.contains(getValue())) {
            bomb( "\"" + getValue() +"\" is not a valid value. Allowed values are ");
        }

        // Get all the parameters to validate their contents
    }
    
    
    public void validateModel() {
        // check uniqueness
    }
}
